package homeWork;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Scanner;
import java.util.TreeSet;

import homeWork.Student;
/*
    声明类Student，包含3个成员变量：name、age、score，
    创建5个对象装入TreeSet，按照成绩排序输出结果（当成绩相同时，按照姓名首字母再次排序）

*/

public class Test3 {
    public static void main(String[]args) {
        Student s1 = new Student(10,50,"a");
        Student s2 = new Student(11,51,"b");
        Student s3 = new Student(12,52,"c");
        Student s4 = new Student(13,53,"d");
        Student s5 = new Student(14,54,"e");
        TreeSet<Student> treeSet = new TreeSet<>();
        treeSet.add(s1);
        treeSet.add(s2);
        treeSet.add(s3);
        treeSet.add(s4);
        treeSet.add(s5);
        for (Student s:treeSet){
            System.out.println(s);
        }


    }
}
